package db.connection;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

public class TestConnectionPool {
	public static void main(String[] args) 
	{
		Connection conn = null;
		ResultSet resultSet = null;
		Statement statement = null;
		ConnectionPool connectionPool=null;

		try {
			connectionPool= ConnectionPool.getIstance();
			
			conn = connectionPool.getConnection();
			
			statement = conn.createStatement();
			resultSet = statement
					.executeQuery("SELECT * FROM stars");
			while (resultSet.next()) {
				System.out.println("EMPLOYEE NAME:"
						+ resultSet.getString("StarID"));
			}
			
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				resultSet.close();
				statement.close();
				connectionPool.releaseConnection(conn);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
}
